﻿@model App.Web.ViewModels.ContentViewModel
@using App.Web.Utility

@{
	String pageTitle = "Edit Content";
    if (Model != null && Model.ID == 0)
    {             
        pageTitle = "Add New Content";
    }
    ViewBag.Title = Html.GetPageTitle(pageTitle);    
}

@Html.JavaScript("jquery.validate.min.js", Url)
@Html.JavaScript("jquery.validate.unobtrusive.min.js", Url)

@Html.Partial("_DatePicker")


<div class="page-heading">
    <h1>@pageTitle</h1>
    <div>
        Add/Edit content details.
    </div>
</div>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

	if (Model == null)
    {
        @: @Html.ErrorMessageBox("Sorry! Requested Content was not found for edit.")
    }
	else
	{
		<div class="GroupBox">
			@*<div class="GroupHeaderOverlay" style="width:140px;">Content Information</div>    *@

			@Html.HiddenFor(model => model.ID)

			<div class="editor-label">
				@Html.LabelFor(model => model.Title)
			</div>
			<div class="editor-field">
				@Html.EditorFor(model => model.Title)
				@Html.ValidationMessageFor(model => model.Title)
			</div>
			<div class="editor-label">
				@Html.LabelFor(model => model.Description)
			</div>
			<div class="editor-field">
				@Html.EditorFor(model => model.Description)  @*, new { cols = 35, @rows = 22 }*@
				@Html.ValidationMessageFor(model => model.Description)
			</div>
			<div class="editor-label">
				@Html.LabelFor(model => model.Summery)
			</div>
			<div class="editor-field">
				@Html.EditorFor(model => model.Summery)
				@Html.ValidationMessageFor(model => model.Summery)
			</div>
            @*<div class="editor-label">
				@Html.LabelFor(model => model.Url)
			</div>
			<div class="editor-field">
				@Html.EditorFor(model => model.Url)
				@Html.ValidationMessageFor(model => model.Url)
			</div>*@
			@Html.HiddenFor(model => model.ModifiedBy)			
			<div>
				<input type="submit" value="Save" />
			</div>
		</div>
	}
}

<div class="GroupBox">
    @Html.AdminLink("Back to List", "List", "Content")
</div>

